Move global decls to a file of their own.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 28 Sep 2005 21:24:05 +0000 (21:24 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 28 Sep 2005 21:24:05 +0000 (21:24 +0000)
gpsbabel/Makefile
gpsbabel/globals.c [new file with mode: 0644]
gpsbabel/main.c

index ff057fe2bd8dccdc582411e8609303be011428ee..6c5f13879040b8972895ab873dd10f884e1fbbd9 100644 (file)
@@ -61,7 +61,7 @@ LIBOBJS = queue.o route.o waypt.o filter_vecs.o util.o vecs.o mkshort.o \
           csv_util.o strptime.o grtcirc.o vmem.o util_crc.o xmlgeneric.o \
           uuid.o formspec.o xmltag.o cet.o cet_util.o \
        $(COLDSYNC) $(GARMIN) $(JEEPS) $(SHAPE) $(FMTS) $(FILTERS)
-OBJS = main.o $(LIBOBJS)
+OBJS = main.o globals.o $(LIBOBJS)
 
 .c.o:
        $(CC) -c $(CFLAGS) $< $(OUTPUT_SWITCH)$@
@@ -78,7 +78,7 @@ usbfree:
 gpsbabel: $(OBJS)
        $(CC) $(CFLAGS) $(OBJS) $(LIBEXPAT) $(LIBUSB) -lm $(OUTPUT_SWITCH)$@
 
-main.o:
+globals.o:
        $(CC) -c $(CFLAGS) -DVERSION=\"$(VERSIOND)\" $< $(OUTPUT_SWITCH)$@
 
 clean:
@@ -185,6 +185,7 @@ gdb.o: gdb.c defs.h queue.h gbtypes.h garmin_tables.h jeeps/gpsmath.h \
 geo.o: geo.c defs.h queue.h gbtypes.h xmlgeneric.h
 geoniche.o: geoniche.c defs.h queue.h gbtypes.h coldsync/palm.h \
   coldsync/pdb.h
+globals.o: globals.c defs.h queue.h gbtypes.h
 glogbook.o: glogbook.c defs.h queue.h gbtypes.h xmlgeneric.h
 google.o: google.c defs.h queue.h gbtypes.h xmlgeneric.h
 gpilots.o: gpilots.c defs.h queue.h gbtypes.h coldsync/palm.h \
diff --git a/gpsbabel/globals.c b/gpsbabel/globals.c
new file mode 100644 (file)
index 0000000..e2329a9
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+    Global data for GSPBabel.
+   
+    Copyright (C) 2005 Robert Lipe, robertlipe@usa.net
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
+
+ */
+
+
+#include "defs.h"
+
+global_options global_opts;
+const char gpsbabel_version[] = VERSION;
+
+
index 3806061b6e2c3a34a19b3e61372eeb899828f120..06e7325715dd224187c2fc3157202e680b64b466 100644 (file)
 #include "cet_util.h"
 #include <ctype.h>
 
-global_options global_opts;
-const char gpsbabel_version[] = VERSION;
-
 static void
 usage(const char *pname, int shorter)
 {
        printf("GPSBabel Version %s.  http://www.gpsbabel.org\n\n",
-                       VERSION );
+                       gpsbabel_version );
        printf(
 "Usage:\n"
 "    %s [options] -i INTYPE -f INFILE -o OUTTYPE -F OUTFILE\n"
@@ -137,7 +134,7 @@ main(int argc, char *argv[])
                }
                
                if (argv[argn][1] == 'V' ) {
-                        printf("\nGPSBabel Version %s\n\n", VERSION );
+                        printf("\nGPSBabel Version %s\n\n", gpsbabel_version );
                         exit(0);
                }
 
@@ -284,7 +281,7 @@ main(int argc, char *argv[])
                                 * When debugging, announce version.
                                 */
                                if (global_opts.debug_level > 0)  {
-                                       warning("GPSBabel Version: " VERSION "\n" );
+                                       warning("GPSBabel Version: %s \n", gpsbabel_version );
                                }
 
                                break;